home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / u_man / cat3 / Tcl / array.z / array
Encoding:
Text File  |  1998-10-30  |  7.8 KB  |  133 lines

  1.  
  2.  
  3.  
  4. aaaarrrrrrrraaaayyyy((((3333TTTTccccllll))))                                                        aaaarrrrrrrraaaayyyy((((3333TTTTccccllll))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      array - Manipulate array variables
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      aaaarrrrrrrraaaayyyy _o_p_t_i_o_n _a_r_r_a_y_N_a_m_e ?_a_r_g _a_r_g ...?
  13.  
  14.  
  15. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  16.      This command performs one of several operations on the variable given by
  17.      _a_r_r_a_y_N_a_m_e.  Unless otherwise specified for individual commands below,
  18.      _a_r_r_a_y_N_a_m_e must be the name of an existing array variable.  The _o_p_t_i_o_n
  19.      argument determines what action is carried out by the command.  The legal
  20.      _o_p_t_i_o_n_s (which may be abbreviated) are:
  21.  
  22.      aaaarrrrrrrraaaayyyy aaaannnnyyyymmmmoooorrrreeee _a_r_r_a_y_N_a_m_e _s_e_a_r_c_h_I_d
  23.           Returns 1 if there are any more elements left to be processed in an
  24.           array search, 0 if all elements have already been returned.
  25.           _S_e_a_r_c_h_I_d indicates which search on _a_r_r_a_y_N_a_m_e to check, and must have
  26.           been the return value from a previous invocation of aaaarrrrrrrraaaayyyy
  27.           ssssttttaaaarrrrttttsssseeeeaaaarrrrcccchhhh.  This option is particularly useful if an array has an
  28.           element with an empty name, since the return value from aaaarrrrrrrraaaayyyy
  29.           nnnneeeexxxxtttteeeelllleeeemmmmeeeennnntttt won't indicate whether the search has been completed.
  30.  
  31.      aaaarrrrrrrraaaayyyy ddddoooonnnneeeesssseeeeaaaarrrrcccchhhh _a_r_r_a_y_N_a_m_e _s_e_a_r_c_h_I_d
  32.           This command terminates an array search and destroys all the state
  33.           associated with that search.  _S_e_a_r_c_h_I_d indicates which search on
  34.           _a_r_r_a_y_N_a_m_e to destroy, and must have been the return value from a
  35.           previous invocation of aaaarrrrrrrraaaayyyy ssssttttaaaarrrrttttsssseeeeaaaarrrrcccchhhh.  Returns an empty string.
  36.  
  37.      aaaarrrrrrrraaaayyyy eeeexxxxiiiissssttttssss _a_r_r_a_y_N_a_m_e
  38.           Returns 1 if _a_r_r_a_y_N_a_m_e is an array variable, 0 if there is no       |
  39.           variable by that name or if it is a scalar variable.
  40.  
  41.      aaaarrrrrrrraaaayyyy ggggeeeetttt _a_r_r_a_y_N_a_m_e ?_p_a_t_t_e_r_n?
  42.           Returns a list containing pairs of elements.  The first element in  |
  43.           each pair is the name of an element in _a_r_r_a_y_N_a_m_e and the second     |
  44.           element of each pair is the value of the array element.  The order  |
  45.           of the pairs is undefined.  If _p_a_t_t_e_r_n is not specified, then all of|
  46.           the elements of the array are included in the result.  If _p_a_t_t_e_r_n is|
  47.           specified, then only those elements whose names match _p_a_t_t_e_r_n (using|
  48.           the glob-style matching rules of ssssttttrrrriiiinnnngggg mmmmaaaattttcccchhhh) are included.  If
  49.           _a_r_r_a_y_N_a_m_e isn't the name of an array variable, or if the array
  50.           contains no elements, then an empty list is returned.
  51.  
  52.      aaaarrrrrrrraaaayyyy nnnnaaaammmmeeeessss _a_r_r_a_y_N_a_m_e ?_p_a_t_t_e_r_n?
  53.           Returns a list containing the names of all of the elements in the   |
  54.           array that match _p_a_t_t_e_r_n (using the glob-style matching rules of    |
  55.           ssssttttrrrriiiinnnngggg mmmmaaaattttcccchhhh).  If _p_a_t_t_e_r_n is omitted then the command returns all  |
  56.           of the element names in the array.  If there are no (matching)      |
  57.           elements in the array, or if _a_r_r_a_y_N_a_m_e isn't the name of an array   |
  58.           variable, then an empty string is returned.
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. aaaarrrrrrrraaaayyyy((((3333TTTTccccllll))))                                                        aaaarrrrrrrraaaayyyy((((3333TTTTccccllll))))
  71.  
  72.  
  73.  
  74.      aaaarrrrrrrraaaayyyy nnnneeeexxxxtttteeeelllleeeemmmmeeeennnntttt _a_r_r_a_y_N_a_m_e _s_e_a_r_c_h_I_d
  75.           Returns the name of the next element in _a_r_r_a_y_N_a_m_e, or an empty
  76.           string if all elements of _a_r_r_a_y_N_a_m_e have already been returned in
  77.           this search.  The _s_e_a_r_c_h_I_d argument identifies the search, and must
  78.           have been the return value of an aaaarrrrrrrraaaayyyy ssssttttaaaarrrrttttsssseeeeaaaarrrrcccchhhh command.
  79.           Warning:  if elements are added to or deleted from the array, then
  80.           all searches are automatically terminated just as if aaaarrrrrrrraaaayyyy
  81.           ddddoooonnnneeeesssseeeeaaaarrrrcccchhhh had been invoked; this will cause aaaarrrrrrrraaaayyyy nnnneeeexxxxtttteeeelllleeeemmmmeeeennnntttt
  82.           operations to fail for those searches.
  83.  
  84.      aaaarrrrrrrraaaayyyy sssseeeetttt _a_r_r_a_y_N_a_m_e _l_i_s_t
  85.           Sets the values of one or more elements in _a_r_r_a_y_N_a_m_e.  _l_i_s_t must    |
  86.           have a form like that returned by aaaarrrrrrrraaaayyyy ggggeeeetttt, consisting of an even  |
  87.           number of elements.  Each odd-numbered element in _l_i_s_t is treated as|
  88.           an element name within _a_r_r_a_y_N_a_m_e, and the following element in _l_i_s_t |
  89.           is used as a new value for that array element.
  90.  
  91.      aaaarrrrrrrraaaayyyy ssssiiiizzzzeeee _a_r_r_a_y_N_a_m_e
  92.           Returns a decimal string giving the number of elements in the array.|
  93.           If _a_r_r_a_y_N_a_m_e isn't the name of an array then 0 is returned.
  94.  
  95.      aaaarrrrrrrraaaayyyy ssssttttaaaarrrrttttsssseeeeaaaarrrrcccchhhh _a_r_r_a_y_N_a_m_e
  96.           This command initializes an element-by-element search through the
  97.           array given by _a_r_r_a_y_N_a_m_e, such that invocations of the aaaarrrrrrrraaaayyyy
  98.           nnnneeeexxxxtttteeeelllleeeemmmmeeeennnntttt command will return the names of the individual elements
  99.           in the array.  When the search has been completed, the aaaarrrrrrrraaaayyyy
  100.           ddddoooonnnneeeesssseeeeaaaarrrrcccchhhh command should be invoked.  The return value is a search
  101.           identifier that must be used in aaaarrrrrrrraaaayyyy nnnneeeexxxxtttteeeelllleeeemmmmeeeennnntttt and aaaarrrrrrrraaaayyyy
  102.           ddddoooonnnneeeesssseeeeaaaarrrrcccchhhh commands; it allows multiple searches to be underway
  103.           simultaneously for the same array.
  104.  
  105.  
  106. KKKKEEEEYYYYWWWWOOOORRRRDDDDSSSS
  107.      array, element names, search
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.